# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=gtksourceview3
pkgver=3.24.4+11+g190037e9
pkgrel=1
pkgdesc="A text widget adding syntax highlighting and more to GNOME"
url="https://wiki.gnome.org/Projects/GtkSourceView"
arch=(i686 x86_64)
license=(GPL)
depends=(gtk3 libxml2)
makedepends=(intltool gobject-introspection glade vala gtk-doc autoconf-archive git)
_commit=190037e9a62d25cb2f678b465b8d0715ae4a5355  # gnome-3-24
source=("git+https://git.gnome.org/browse/gtksourceview#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd gtksourceview
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd gtksourceview
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd gtksourceview
  ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --disable-static \
      --enable-glade-catalog --enable-gtk-doc --disable-Werror
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd gtksourceview
  make DESTDIR="$pkgdir" install
}
